/*renderBlog = strand(function () {						*/renderBlog=function(){var _f = _frm(arguments);var _cp=_f.scp;_s:while(1){switch(_cp){case 1:_cp=2;case 2:if((_f.v2=
/*	var blog = yield (yield pjs.load("root")).blog; // get the blog object, the list of the postings						*/pjs.load("root"))===_S){break _s;}_cp=3;case 3:if((_f.v3=_g((_f.v2),"blog"))===_S){break _s;}var blog=_f.v3;_p(
/*	document.getElementById('newPost').style.display='none';						*/document.getElementById("newPost").style,"display","none");
/*	blogElement = document.getElementById("blogDiv");						*/blogElement=document.getElementById("blogDiv");_p(
/*	blogElement.innerHTML = ""; // clear it out						*/blogElement,"innerHTML","");
/*	for (var i =0; i < (yield blog.length);i++) // iterate through the blog posts						*/var i=0;case 5:_cp=6;case 6:if((_f.v6=_g(blog,"length"))===_S){break _s;}_cp=(i<(_f.v6))?7:8;break;case 7:_cp=9;case 9:if((_f.v9=_g(
/*		renderPost((yield blog[i]),blogElement.appendChild(document.createElement('div'))); // render each post in a new div						*/blog,i))===_S){break _s;}_cp=10;case 10:if((_f.v10=renderPost((_f.v9),blogElement.appendChild(document.createElement("div"))))===_S){break _s;}case 4:i++;_cp=5;break;case 8:return;case 0:blog=_f[0];i=_f[1];_cp=_f.cp;}}return _f.sus(blog,i,_cp,this)};
/*});						*/
/*renderPost = strand(function(post,postDiv,withComments) {						*/renderPost=function(post,postDiv,withComments){var _f = _frm(arguments);var _cp=_f.scp;_s:while(1){switch(_cp){case 1:_cp=2;case 2:if((_f.v2=_g(
/*	var html = "<h2>" + (yield post.title) + "</h2>" 						*/post,"title"))===_S){break _s;}_cp=3;case 3:if((_f.v3=_g(
/*		+ "<h4>" + (yield post.created) + "</h4><p>" + (yield post.content) + "</p>"; 						*/post,"created"))===_S){break _s;}_cp=4;case 4:if((_f.v4=_g(post,"content"))===_S){break _s;}var html="<h2>"+(_f.v2)+"</h2>"+"<h4>"+(_f.v3)+"</h4><p>"+(_f.v4)+"</p>";
/*	if (withComments) {						*/_cp=(withComments)?5:6;break;case 5:
/*		for (var i = 0; i < (yield (yield post.comments).length); i++) {						*/var i=0;case 8:_cp=9;case 9:if((_f.v9=_g(post,"comments"))===_S){break _s;}_cp=10;case 10:if((_f.v10=_g((_f.v9),"length"))===_S){break _s;}_cp=(i<(_f.v10))?11:12;break;case 11:_cp=13;case 13:if((_f.v13=_g(
/*			var comment = yield post.comments[i];						*/post.comments,i))===_S){break _s;}var comment=_f.v13;_cp=14;case 14:if((_f.v14=_g(
/*			html += "<div class='comment'>" + (yield comment.content) + "</div><div class='author'>" 						*/comment,"content"))===_S){break _s;}_cp=15;case 15:if((_f.v15=_g(
/*				+ (yield comment.author) + " on " + (yield comment.created) + "</div>";						*/comment,"author"))===_S){break _s;}_cp=16;case 16:if((_f.v16=_g(comment,"created"))===_S){break _s;}html+="<div class='comment'>"+(_f.v14)+"</div><div class='author'>"+(_f.v15)+" on "+(_f.v16)+"</div>";case 7:i++;_cp=8;break;case 12:_cp=6;break;case 6:_p(
/*		}						*/
/*	}						*/
/*	document.getElementById('newComment').style.display=withComments ? 'block' : 'none';						*/document.getElementById("newComment").style,"display",withComments?"block":"none");_p(
/*	postDiv.innerHTML = html;						*/postDiv,"innerHTML",html);_p(
/*	postDiv.onclick = function() {						*/postDiv,"onclick",function(){
/*		renderPost(post,blogElement,true);						*/renderPost(post,blogElement,true);
/*		currentPost = post;						*/currentPost=post;});_p(
/*	}						*/
/*	postDiv.className="post";						*/postDiv,"className","post");return;case 0:comment=_f[0];postDiv=_f[1];html=_f[2];i=_f[3];post=_f[4];withComments=_f[5];_cp=_f.cp;}}return _f.sus(comment,postDiv,html,i,post,withComments,_cp,this)};
/*});						*/
/*function addBlogPost() {						*/function addBlogPost(){
/*	var blog = pjs.load("root").blog; // we know this has already been loaded, so we won't worry about lazy loading						*/var blog=pjs.load("root").blog;
/*	var newPost = {						*/var newPost={
/*		title : "new post",						*/title:"new post",
/*		content : document.getElementById('newPostContent').value,						*/content:document.getElementById("newPostContent").value,
/*		created : new Date(),						*/created:new Date,
/*		comments : [] // an empty array of comments						*/comments:[]};
/*	};						*/
/*	blog.unshift(newPost); // add a new post to the top of the array using standard array functions						*/blog.unshift(newPost);
/*	newPost.title = prompt("What would you like to title the new post?",newPost.title);						*/newPost.title=prompt("What would you like to title the new post?",newPost.title);
/* 	renderBlog();						*/renderBlog();}

/*}						*/
/*function addCommentEntry() {						*/function addCommentEntry(){
/*	var commentsDiv = document.getElementById("newComment")						*/var commentsDiv=document.getElementById("newComment");
/*	currentPost.comments.push({						*/currentPost.comments.push({
/*		author : document.getElementById('newCommentAuthor').value,						*/author:document.getElementById("newCommentAuthor").value,
/*		content : document.getElementById('newCommentContent').value,						*/content:document.getElementById("newCommentContent").value,
/*		created : new Date()						*/created:new Date}
/*	});						*/);
/*	renderPost(currentPost,blogElement,true);						*/renderPost(currentPost,blogElement,true);}
/*}						*/
/*renderBlog();						*/renderBlog();

